Add smarter description handling if suppressing smart icons.
authorrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Wed, 9 Feb 2005 16:28:56 +0000 (16:28 +0000)
committerrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Wed, 9 Feb 2005 16:28:56 +0000 (16:28 +0000)
gpsbabel/garmin.c

index 723a57ce53b254da92010eeb1cb3001f28af82a3..9c433408700fe10939e49718ccb1424d58b07b6b 100644 (file)
@@ -408,6 +408,22 @@ waypt_write_cb(GPS_PWay *way)
        return 0;
 }
 
+/* 
+ * If we're not using smart icons, try to put the cache info in the
+ * description.
+ */
+const char *
+get_gc_info(waypoint *wpt)
+{
+       if (global_opts.no_smart_icons) {
+               if (wpt->gc_data.type == gt_virtual) return  "V ";
+               if (wpt->gc_data.type == gt_unknown) return  "? ";
+               if (wpt->gc_data.type == gt_multi) return  "Mlt ";
+               if (wpt->gc_data.container == gc_micro) return  "M ";
+       }
+       return "";
+}
+
 static void
 waypoint_write(void)
 {
@@ -459,7 +475,7 @@ waypoint_write(void)
 
                if (wpt->gc_data.diff && wpt->gc_data.terr) {
                        snprintf(obuf, sizeof(obuf), "%s%d/%d %s", 
-wpt->gc_data.container == gc_micro ?  "M " : "", 
+                                       get_gc_info(wpt),
                                        wpt->gc_data.diff, wpt->gc_data.terr, 
                                        src);
                        memcpy(way[i]->cmnt, obuf, strlen(obuf));